import { request } from "@/utils/request";

const prefix = "/admin/";

// 登录
export const login = (data) => {
  return request({ url: prefix + "index/index", method: "post", data });
};

// 注册
export const register = (data) => {
  return request({ url: prefix + "user/register", method: "post", data });
};

// 捐赠项目--列表
export const getDonationList = (data) => {
  return request({ url: prefix + "donation/index", method: "get", data });
};

// 捐赠项目--详情
export const getDonationDetail = (data) => {
  return request({ url: prefix + "donation/edit", method: "get", data });
};

// 捐赠项目进展--新增、编辑
export const editDonation = (data) => {
  return request({ url: prefix + "donation/edit", method: "post", data });
};

// 捐赠项目--修改状态
export const chgDonationStatus = (data) => {
  return request({ url: prefix + "donation/change", method: "post", data });
};

// 捐赠项目--列表--全部（不区分状态值等，主要用于下拉列表）
export const getDonationListAll = (data) => {
  return request({ url: prefix + "donation/list_all", method: "get", data });
};

// 捐赠项目进展--列表
export const getDonationProgressList = (data) => {
  return request({ url: prefix + "donation_progress/index", method: "get", data });
};

// 捐赠项目进展--详情
export const getDonationProgressDetail = (data) => {
  return request({ url: prefix + "donation_progress/edit", method: "get", data });
};

// 捐赠项目进展--修改状态
export const chgDonationProgressStatus = (data) => {
  return request({ url: prefix + "donation_progress/change", method: "post", data });
};

// 捐赠项目进展--新增、编辑
export const editDonationProgress = (data) => {
  return request({ url: prefix + "donation_progress/edit", method: "post", data });
};

// 视频管理--列表
export const getVideoList = (data) => {
  return request({ url: prefix + "video/index", method: "get", data });
};

// 视频管理--详情
export const getVideoDetail = (data) => {
  return request({ url: prefix + "video/edit", method: "get", data });
};

// 视频管理--修改状态
export const chgVideoStatus = (data) => {
  return request({ url: prefix + "video/change", method: "post", data });
};

// 视频管理--新增、编辑
export const editVideo = (data) => {
  return request({ url: prefix + "video/edit", method: "post", data });
};

// 账号管理--列表
export const getAdminList = (data) => {
  return request({ url: prefix + "admin/index", method: "get", data });
};

// 账号管理--详情
export const getAdminDetail = (data) => {
  return request({ url: prefix + "admin/edit", method: "get", data });
};

// 账号管理--修改状态
export const chgAdminStatus = (data) => {
  return request({ url: prefix + "admin/change", method: "post", data });
};

// 账号管理--新增、编辑
export const editAdmin = (data) => {
  return request({ url: prefix + "admin/edit", method: "post", data });
};

// 角色管理--列表
export const getAdminRolesList = (data) => {
  return request({ url: prefix + "admin_roles/index", method: "get", data });
};

// 角色管理--列表（正常状态，下拉）
export const getAdminRolesListOk = (data) => {
  return request({ url: prefix + "admin_roles/list_ok", method: "get", data });
};

// 角色管理--详情
export const getAdminRolesDetail = (data) => {
  return request({ url: prefix + "admin_roles/edit", method: "get", data });
};

// 角色管理--修改状态
export const chgAdminRolesStatus = (data) => {
  return request({ url: prefix + "admin_roles/change", method: "post", data });
};

// 角色管理--新增、编辑
export const editAdminRoles = (data) => {
  return request({ url: prefix + "admin_roles/edit", method: "post", data });
};

// 菜单管理--列表
export const getAdminMenuList = (data) => {
  return request({ url: prefix + "admin_menu/index", method: "get", data });
};

// 菜单管理--列表（正常状态，下拉）
export const getAdminMenuListOk = (data) => {
  return request({ url: prefix + "admin_menu/list_ok", method: "get", data });
};

// 菜单管理--修改状态
export const chgAdminMenuStatus = (data) => {
  return request({ url: prefix + "admin_menu/change", method: "post", data });
};

// 菜单管理--新增、编辑
export const editAdminMenu = (data) => {
  return request({ url: prefix + "admin_menu/add", method: "post", data });
};

// 用户--列表
export const getUserList = (data) => {
  return request({ url: prefix + "user/index", method: "get", data });
};

// 用户--修改状态
export const chgUserStatus = (data) => {
  return request({ url: prefix + "user/change", method: "post", data });
};

// 与我联系--列表
export const getContactMeList = (data) => {
  return request({ url: prefix + "contact_me/index", method: "get", data });
};

// 与我联系--修改状态
export const chgContactMeStatus = (data) => {
  return request({ url: prefix + "contact_me/change", method: "post", data });
};

// 与我联系--详情
export const getContactMeDetail = (data) => {
  return request({ url: prefix + "contact_me/detail", method: "get", data });
};

// 通用设置--获取数据信息
export const getCommonSetData = (data, method) => {
  return request({ url: prefix + "common_set/"+method, method: "get", data });
};

// 通用设置--保存
export const chgCommonSet = (data) => {
  return request({ url: prefix + "common_set/edit", method: "post", data });
};











